﻿using System;
using System.Collections.Generic;
using System.Web;

namespace Report
{
    [Serializable]
    public class Leaf : IItem
    {
        public Leaf()
        {
              ContentSummary = string.Empty;
            FirstLevel = string.Empty;
            SecondLevel = string.Empty;
        }

        public string ParentName { get; set; }
        public string FirstLevel { get; set; }
        public string SecondLevel { get; set; }
        public string ContentSummary { get; set; }

        public string Name { get; set; }
        public DateTime AddDate { get; set; }
        public float Income { get; set; }
        public float Cost { get; set; }
        public float Borrow { get; set; }
        public float Lent { get; set; }

        public IItem Add(IItem item)
        {
            return item;
        }

        public IItem Remove(IItem item)
        {
            return item;
        }

     

        public IItem GetbyName(string name)
        {
            return Name == name ? this : null;
        }

        public IList<IItem> GetChildern()
        {
            return new List<IItem>();
        }

        public string Comment { get; set; }
        public float ExistingIncome {
            get { return Income - Cost; }
            set { }
        }

        public float ShouldHaveIncome { get { return ExistingIncome - Borrow + Lent; }
            set { }
        }
    }
}